package com.wushi.lenovo.asia5b.app_http;

import com.mvp.base.model.ResultModel;
import com.mvp.common.GlobalValue;
import com.wushi.lenovo.asia5b.app_model.credit.BankModel;
import com.wushi.lenovo.asia5b.app_model.credit.EmailModel;
import com.wushi.lenovo.asia5b.app_model.credit.MemberBlanceModel;
import com.wushi.lenovo.asia5b.app_model.credit.TopupHisModel;
import com.wushi.lenovo.asia5b.app_model.credit.TransactionHisModel;
import com.wushi.lenovo.asia5b.app_model.credit.TransferHisModel;
import com.wushi.lenovo.asia5b.app_model.credit.WithdrawBankModel;
import com.wushi.lenovo.asia5b.app_model.credit.WithdrawHisModel;
import com.wushi.lenovo.asia5b.app_model.good.AddCartModel;
import com.wushi.lenovo.asia5b.app_model.good.OrderCancelModel;
import com.wushi.lenovo.asia5b.app_model.good.OrderMsgCountModel;
import com.wushi.lenovo.asia5b.app_model.good.OrderPackModel;
import com.wushi.lenovo.asia5b.app_model.good.OrderPayPriceModel;
import com.wushi.lenovo.asia5b.app_model.good.PriceModel;
import com.wushi.lenovo.asia5b.app_model.good.ShopCarCountModel;
import com.wushi.lenovo.asia5b.app_model.good.ShopModel;
import com.wushi.lenovo.asia5b.app_model.good.SnapGoodsModel;
import com.wushi.lenovo.asia5b.app_model.good.TaokouModel;
import com.wushi.lenovo.asia5b.app_model.good.ThirdContentModel;
import com.wushi.lenovo.asia5b.app_model.good.ThridMallModel;
import com.wushi.lenovo.asia5b.app_model.good.ValidateVouchreResModel;
import com.wushi.lenovo.asia5b.app_model.good.orderitem.SOrderItemModel;
import com.wushi.lenovo.asia5b.app_model.inbox.InboxMsgModel;
import com.wushi.lenovo.asia5b.app_model.inbox.SInboxMsgModel;
import com.wushi.lenovo.asia5b.app_model.other.AdvModel;
import com.wushi.lenovo.asia5b.app_model.other.CategoryModel;
import com.wushi.lenovo.asia5b.app_model.other.CountModel;
import com.wushi.lenovo.asia5b.app_model.other.H5VersionModel;
import com.wushi.lenovo.asia5b.app_model.other.UpdateModel;
import com.wushi.lenovo.asia5b.app_model.other.UserInfo;
import com.wushi.lenovo.asia5b.app_model.profile.CodeModel;
import com.wushi.lenovo.asia5b.app_model.profile.CountryModel;
import com.wushi.lenovo.asia5b.app_model.profile.LanguageModel;
import com.wushi.lenovo.asia5b.app_model.profile.PostCodeModel;
import com.wushi.lenovo.asia5b.app_model.profile.ProvinceOrCityModel;
import com.wushi.lenovo.asia5b.app_model.profile.ValidModel;
import com.wushi.lenovo.asia5b.app_model.result.AddressResModel;
import com.wushi.lenovo.asia5b.app_model.result.LoginResModel;
import com.wushi.lenovo.asia5b.app_model.result.WishResModel;
import com.wushi.lenovo.asia5b.app_model.voucher.VoucherModel;
import com.wushi.lenovo.asia5b.app_model.wish.GoodsDetailModel;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * ================================================
 * Created by ${chenyuexueer}
 * 时间： 2018/6/5.
 * 说明：
 * ================================================
 */
public interface ApiService {

    //获取数量
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "{url}")
    Observable<ResultModel<CountModel>> getCount(@Path("url") String url, @Field("member_id") int member_id
    );

    /**
     * 更新设备token
     * member_id	integer	Id of the specified member	YES
     * app_register_id	String	Device token id (required if without app_register_device&app_register_error_msg)	YES / NO
     * app_os	Integer	1 = Android , 2 = IOS	YES
     * app_notification_type	String	0 = firebase, 1 = umeng (default: firebase)	No
     * app_register_device	String	App register device model (required if app_register_id is empty)	YES / NO
     * app_register_error_msg	String	App register error message (required if app_register_id is empty)	YES / NO
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.app.device.update")
    Observable<ResultModel> updateDeviceToken(@FieldMap Map<String, Object> map
    );

    /**
     * 注册
     * <p>
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.manual.register.android")
    Observable<ResultModel<LoginResModel>> register(@FieldMap Map<String, Object> map
    );

    //获取登录人的资料
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.data")
    Observable<ResultModel<UserInfo>> getUserInfo(
            @Field("member_id") int member_id
    );

    /**
     * 登录
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.manual.login")
    Observable<ResultModel<LoginResModel>> login(@FieldMap Map<String, Object> map);

    /**
     * 登出
     * member_id	Integer	Member ID	Yes
     * logout_time	Datetime	Format: Y-m-d H:i:s Etc: 2020-02-27 11:05:00	Yes
     * logout_key	Varchar	Private Key: ASIA5B_2020_7uepVrlKxWE7eahtaXHr7wtg
     * Md5(member_id + “_” + logout_unix_time + “_” + Private Key)   Etc: md5(“1476_1582772700_ ASIA5B_2020_7uepVrlKxWE7eahtaXHr7wtg”)	Yes
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.manual.logout")
    Observable<ResultModel> logout(@Header("Authorization") String token, @FieldMap Map<String, Object> map);

    /**
     * 第三方登录
     * email	String	Login Credential would be email address	YES , NO for wechat type
     * third_id	String	the Auth ID of the social media 	YES
     * type	String	Social Media Type - 'facebook','google','wechat'	YES
     * app_register_id	String	The device id of mobile	YES
     * app_os	Integer	1 = Android , 2 = IOS	YES
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.social.media.login")
    Observable<ResultModel<LoginResModel>> loginThird(@FieldMap Map<String, Object> map);

    //绑定手机号至facebook
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.facebook.bind.mobile")
    Observable<ResultModel> bindFacebookMobile(@FieldMap Map<String, Object> map);

    /**
     * 绑定手机号和邮箱至wechat
     * union_id	String	Wechat’s union id
     * email	String	user ‘s email
     * name	String	Wechat’s nickname
     * mobile	numeric	Mobile number
     * otp	numeric	OTP code
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.wechat.bind.email.send")
    Observable<ResultModel> bindWechatMobileAndEmail(@FieldMap Map<String, Object> map);

    //更新用户头像
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.avatar.update")
    Observable<ResultModel> updateMemberHead(@Field("member_id") int member_id, @Field("avatar_url") String avatar_url);

    /**
     * 短信登录
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.manual.sms.login")
    Observable<ResultModel<LoginResModel>> loginSms(@FieldMap Map<String, Object> map
    );

    //获取国家列表
    @GET(GlobalValue.Base_Version_Url + "get.enabled.country.listing")
    Observable<ResultModel<List<CountryModel>>> getCountrys();

    //获取州/省
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "state.search")
    Observable<ResultModel<List<ProvinceOrCityModel>>> getProvincesById(@Field("country_id") int country_id);

    //获取城市
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cities.search")
    Observable<ResultModel<List<ProvinceOrCityModel>>> getCityesById(@Field("state_id") int state_id);

    //获取邮编
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "get.postcode.by.city.id")
    Observable<ResultModel<PostCodeModel>> getPostCodeByCity(@Field("city_id") int city_id);

    //获取所有地址
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.address.get")
    Observable<ResultModel<AddressResModel>> getAddresses(
            @Field("member_id") int member_id
    );

    //创建地址
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.address.create")
    Observable<ResultModel> addAddress(
            @FieldMap Map<String, Object> map
    );

    //修改地址
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.address.edit")
    Observable<ResultModel> updateAddress(
            @FieldMap Map<String, Object> map
    );

    //删除地址
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.address.delete")
    Observable<ResultModel> deleteAddress(
            @Field("address_id") int address_id
    );

    /**
     * 设置默认地址
     *
     * @param address_id
     * @param member_id
     * @param type       ship_address_id '或' bill_address_id
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.address.setDefault")
    Observable<ResultModel> setDefaultAddress(
            @Field("address_id") int address_id,
            @Field("member_id") int member_id,
            @Field("type") String type
    );

    /**
     * 发送验证码用于注册
     *
     * @param mobile_num   手机号
     * @param calling_code 国家编号
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.otp.send.registration")
    Observable<ResultModel<CodeModel>> sendCodeForRegister(
            @Field("mobile_num") String mobile_num,
            @Field("calling_code") String calling_code
    );

    //修改手机号的验证码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.otp.send.modifyMobile")
    Observable<ResultModel<CodeModel>> sendCodeForChangeMobile(
            @Field("mobile_num") String mobile_num,
            @Field("calling_code") String calling_code
    );

    //修改登录密码的验证码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.otp.login.password.change")
    Observable<ResultModel<CodeModel>> sendCodeForChangeLoginPass(
            @Field("member_id") String member_id
    );

    //重置支付密码的验证码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.otp.send.resetPaymentPassword")
    Observable<ResultModel<CodeModel>> sendCodeForResetPayPass(
            @Field("member_id") String member_id
    );

    //修改支付密码的验证码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.otp.payment.password.change")
    Observable<ResultModel<CodeModel>> sendCodeForChangePaymentPass(
            @Field("member_id") String member_id
    );

    //忘记登录密码的验证码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.otp.send.forgot.password")
    Observable<ResultModel<CodeModel>> sendCodeForResetLoginPass(
            @Field("email") String email
    );

    //SMS登录的验证码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.otp.send.sms.login")
    Observable<ResultModel<CodeModel>> sendCodeForSmsLogin(
            @Field("mobile_num") String mobile_num,
            @Field("calling_code") String calling_code
    );

    //重置登录密码,给用户发邮件
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.email.send.forgot.password")
    Observable<ResultModel> sendEmailForResetLoginPass(
            @Field("email") String email
    );

    //绑定facebook的验证码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.otp.send.facebook.bind.mobile")
    Observable<ResultModel<CodeModel>> sendCodeForBindFacebook(
            @Field("mobile_num") String mobile_num,
            @Field("calling_code") String calling_code
    );

    //绑定微信的验证码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.otp.send.wechat.bind.email")
    Observable<ResultModel<CodeModel>> sendCodeForBindWechat(
            @Field("mobile_num") String mobile_num,
            @Field("calling_code") String calling_code
    );

    //验证支付密码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.paymentPassword.verify")
    Observable<ResultModel> checkPayPass(
            @Field("member_id") int member_id,
            @Field("payment_password") String payment_password
    );

    //获取支持的语言列表
    @POST(GlobalValue.Base_Version_Url + "get.enabled.language.listing")
    Observable<ResultModel<List<LanguageModel>>> getLanguages(
    );

    /**
     * 合并登录前后的购物车
     *
     * @param session_id 设备号
     * @param member_id  0表示未登录
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.load")
    Observable<ResultModel> mergeShopCar(
            @Field("session_id") String session_id,
            @Field("member_id") int member_id
    );

    /**
     * 获取购物车商品列表
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.get.products")
    Observable<ResultModel<List<ShopModel>>> getGoodsMall(@FieldMap Map<String, Object> stringMap
    );


    /**
     * 添加购物车
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.apiadd")
    Observable<ResultModel<AddCartModel>> addGoodMall(
            @FieldMap Map<String, Object> stringMap
    );

    /**
     * 移除购物车中的产品
     *
     * @param cart_id
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.apiremove")
    Observable<ResultModel> removeGoodMall(
            @Field("cart_id") int cart_id,
            @Field("session_id") String session_id,
            @Field("member_id") int member_id
    );

    /**
     * 移除购物车中的产品
     * cart_ids	integer	Cart Item’s ID list you want to remove, e.g [123273,182383]	YES
     * member_id	integer	Id of the specified member, zero is equal not login customer	NO
     * session_id	string	Member Cart Session ID, e.g. fb1073a1231cbf8428b77da3b6	YES
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.apibulkremove")
    Observable<ResultModel> removeGoodList(
            @Field("cart_ids") String cart_ids,
            @Field("session_id") String session_id,
            @Field("member_id") int member_id
    );

//    /**
//     * 更新购物车数量
//     *
//     * @param cart_id
//     * @param qty
//     * @param session_id
//     * @param member_id  0表示未登录
//     * @return
//     */
//    @FormUrlEncoded
//    @POST(GlobalValue.Base_Version_Url + "cart.apiupdate")
//    Observable<ResultModel> updateGoodNumMall(
//            @Field("session_id") String session_id
//            , @Field("member_id") int member_id
//            , @Field("cart_id") int cart_id
//            , @Field("qty") int qty
//
//    );

    //更新购物车商品信息
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.apiupdate")
    Observable<ResultModel> updateGood(
            @FieldMap Map<String, Object> map

    );

    /**
     * 更新备注
     *
     * @param session_id
     * @param member_id
     * @param cart_id
     * @param remark
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.apiremarkupdate")
    Observable<ResultModel> updateGoodRemarkMall(
            @Field("session_id") String session_id
            , @Field("member_id") int member_id
            , @Field("cart_id") int cart_id
            , @Field("remark") String remark

    );

    /**
     * 提交订单
     * member_id	integer	Id of the specified member
     * language_code	string	Language code, e.g. en, cn
     * products	string	Array of product list (refer below products (JSON))
     * source	string	Source of the daigou country, default 1 = china daigou
     * type	integer	Type of product, “daigou” or “marketplace”
     * country_id	string	Country ID, e.g. 87 = Malaysia
     * confirm_order	integer	Identify is it get place order’s charges or checkout payment’s charges, 1 = place order, 0 = checkout payment
     * data	string	Products’s Remark, e.g. {"comments":{"487":"123123","488":null,"489":null,"484":null,"485":null,"486":null,"480":null,"481":"123123213","482":null,"483":null}}
     * session_id	string	Member Cart Session ID, e.g. fb1073a1231cbf8428b77da3b6
     * <p>
     * todo 如果提交失败,很可能是用户没有编辑用户名
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.place.order")
    Observable<ResultModel> placeOrder(
            @FieldMap Map<String, Object> map

    );

    /**
     * 收取所有成本费用(如国际费用、本地费用、保险费、总价、总价等)、产品
     * member_id	integer	Id of the specified member
     * language_code	string	Language code, e.g. en, cn
     * products	string	Array of product list (refer below products (JSON))
     * source	string	Source of the daigou country, default 1 = china daigou
     * type	integer	Type of product, “daigou” or “marketplace”
     * country_id	string	Country ID, e.g. 87 = Malaysia
     * confirm_order	integer	Identify is it get place order’s charges or checkout payment’s charges, 1 = place order, 0 = checkout payment
     * extra_data	string	Array of extra data (refer below Extra Data (JSON)), Leave Blank for place order
     * todo 自营商品的提交方式:/cart.get.charges?member_id=929&extra_data=[]&country_id=4&products=[]&source=1&language_code=en&type=marketplace&confirm_order=1
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.get.charges")
    Observable<ResultModel<PriceModel>> getChargesPlaceOrder(
            @FieldMap Map<String, Object> map
    );

    //获取订单价格信息
    /*
    pack_order
第一次付款pack_order=0,
代购第一次付款 confirm_order=1
商城付款 confirm_order=0

二次付款， pack_order=0, confirm_order=0
差价付款， pack_order=0, confirm_order=0
申请打包, pack_order=1, confirm_order=0
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.get.charges")
    Observable<ResultModel<OrderPayPriceModel>> getChargesOrderPay(
            @FieldMap Map<String, Object> map
    );


    //获取订单打包信息
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "orderdg.pack.load.data")
    Observable<ResultModel<OrderPackModel>> getPackData(
            @FieldMap Map<String, Object> map
    );

    //申请打包
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "orderdg.pack.new.order")
    Observable<ResultModel> postPack(
            @FieldMap Map<String, Object> map
    );

    //获取购物车数量
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "cart.get.products.qty")
    Observable<ResultModel<ShopCarCountModel>> getGouwucheNum(
            @FieldMap Map<String, Object> map
    );

    /**
     * 获取首页数据
     *
     * @param lang
     * @return
     */
    @GET(GlobalValue.Base_Version_Url + "slider.getall/{lang}")
    Observable<ResultModel> getHomeData(
            @Path("lang") String lang
    );

    //更新个人信息
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.profile.update")
    Observable<ResultModel> updataMember(@FieldMap Map<String, Object> map);

    //更新手机号码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.phone.update")
    Observable<ResultModel> updataPhone(@FieldMap Map<String, Object> map);

    //修改登录密码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.loginPassword.change")
    Observable<ResultModel> changeLoginPassWord(@FieldMap Map<String, Object> map);

    //忘记密码但是知道旧密码修改登录密码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.forgot.password.reset")
    Observable<ResultModel> resetLoginPassWord(@FieldMap Map<String, Object> map);

    //忘记密码但是不知道旧密码修改登录密码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.login.password.reset")
    Observable<ResultModel> resetLoginPassWord2(@FieldMap Map<String, Object> map);

    //修改支付密码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.paymentPassword.change")
    Observable<ResultModel> changePaymentPassWord(@Field("member_id") int member_id,
                                                  @Field("new_payment_password") String new_payment_password,
                                                  @Field("otp") String otp);

    //修改登录密码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.paymentPassword.resetByOTP")
    Observable<ResultModel> changePaymentPassWordByOTP(@Field("member_id") int member_id,
                                                       @Field("new_payment_password") String new_payment_password,
                                                       @Field("otp") String otp);

    //修改支付密码
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.paymentPassword.change")
    Observable<ResultModel> changePaymentPassWord(@FieldMap Map<String, Object> map);


    //用户名转账记录
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.fund.transfer")
    Observable<ResultModel> getUsernameTransferAccount(@FieldMap Map<String, Object> objectMap);

    //提交取现申请
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.withdraw.submit")
    Observable<ResultModel> getSubmitWithdrawData(@FieldMap Map<String, Object> objectMap);

    //获取用户余额
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.balance.get")
    Observable<ResultModel<MemberBlanceModel>> getMemberBalance(@Field("member_id") int member_id);


    //检查邮箱是否存在
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.forgot.password.verify.email")
    Observable<ResultModel<String>> checkEmail(@Field("email") String email);

    //检测该邮箱是否被注册
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.register.verify.email")
    Observable<ResultModel<ValidModel>> checkEmailByRegister(@Field("email") String email);

    //检测该手机号是否被注册
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "auth.register.verify.mobile")
    Observable<ResultModel<ValidModel>> checkMobileByRegister(@Field("mobile") String mobile,
                                                              @Field("country_id") String country_id);


    /**
     * 获取收藏列表
     *
     * @param map
     * @return
     * @country_id 1) Display currency by country id.
     * 2)If empty will get by member’s country id.
     * 3)If still empty will default to Malaysia (Default: 4).
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.wishlist.record")
    Observable<ResultModel<WishResModel>> getWishList(@FieldMap Map<String, Object> map
    );

    //删除收藏
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.wishlist.delete")
    Observable<ResultModel> deleteWish(@Field("member_id") int member_id,
                                       @Field("product_id") String product_id
    );

    //添加收藏
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.wishlist.add")
    Observable<ResultModel> addWish(@Field("member_id") int member_id,
                                    @Field("product_id") String product_id
    );

    /**
     * 列出一张可供索取的代金券清单
     * member_id	integer	Member’s id	YES
     * lang	string	language ,  Options : ( en , cn )	YES
     *
     * @param member_id
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "voucher.grab.all.available")
    Observable<ResultModel> getVoucherAvailable(@Field("member_id") int member_id
    );


    /**
     * 获取成员的Voucher记录显示(未使用),表示有效的优惠券
     * member_id	integer	Member’s id	YES
     * lang	string	language ,  Options : ( en , cn )	YES
     *
     * @param member_id
     * @param member_id
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "voucher.get.unused")
    Observable<ResultModel<List<VoucherModel>>> getVoucherUnused(@Field("member_id") int member_id, @Field("lang") String lang
    );

    /**
     * 获得会员使用的凭证 使用过的优惠券
     * member_id	integer	Member’s id	YES
     * lang	string	language ,  Options : ( en , cn )	YES
     *
     * @param member_id
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "voucher.get.used")
    Observable<ResultModel<List<VoucherModel>>> getVoucherUsed(@Field("member_id") int member_id, @Field("lang") String lang
    );

    /**
     * 获得会员过期凭证
     * member_id	integer	Member’s id	YES
     * lang	string	language ,  Options : ( en , cn )	YES
     *
     * @param member_id
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "voucher.get.expired")
    Observable<ResultModel<List<VoucherModel>>> getVoucherExpired(@Field("member_id") int member_id, @Field("lang") String lang
    );

    /**
     * 获取指定成员的凭单
     *
     * @param member_id
     * @param voucher_code 优惠券编号 NEW001
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "voucher.grab")
    Observable<ResultModel> getVoucherGrab(@Field("member_id") int member_id
            , @Field("voucher_code") String voucher_code
    );

    /**
     * 获取会员可用的抓取凭证
     *
     * @param member_id
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "voucher.grabGetData")
    Observable<ResultModel<List<VoucherModel>>> grabGetVouchers(@Field("member_id") int member_id
    );

    /**
     * 验证优惠券是否可使用
     *
     * @param map public, grab, assign, all
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "voucher.validate")
    Observable<ResultModel<ValidateVouchreResModel>> validateVoucher(@FieldMap Map<String, Object> map
    );

    /**
     * member_id	Integer	Id of the specified member	YES
     * lang	String	language code etc:’en’,’cn’ (Default: ‘en’)	NO
     * page_id	Integer	Number of pagination (Default: 1)	NO
     * records	Integer	Display records per page (Default: 10)	NO
     *
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "get.OrderNotification")
    Observable<ResultModel<SInboxMsgModel>> getMsgOrders(@FieldMap Map<String, Object> map
    );

    //未读消息数量
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "count.UnreadOrderNotification")
    Observable<ResultModel<OrderMsgCountModel>> getMsgOrderCount(@Field("member_id") int member_id
    );

    /**
     * 更新已阅读消息
     *
     * @param member_id
     * @param notification_id
     * @param notification_type “promo_notification” or ” order_notification”
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "read.Notification")
    Observable<ResultModel> readNotification(@Field("member_id") int member_id
            , @Field("notification_id") int notification_id
            , @Field("notification_type") String notification_type
    );

    //获取个人消息列表
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "get.inboxNotification")
    Observable<ResultModel<List<InboxMsgModel>>> getMsgInboxs(@Field("member_id") int member_id
            , @Field("lang") String lang
    );

    //获取未读消息数
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "get.inboxNotification")
    Observable<ResultModel> getMsgInboxCount(@Field("member_id") int member_id
            , @Field("lang") String lang
    );


    /**
     * 是否收藏
     *
     * @param member_id
     * @param prodId
     * @param lang       language example ‘en’ YES & NO
     * @param country_id Country’s ID. Default: 4 YES & NO
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "prod.get.single")
    Observable<ResultModel<GoodsDetailModel>> getGoodDetail(@Field("member_id") String member_id
            , @Field("prodId") String prodId
            , @Field("lang") String lang
            , @Field("country_id") String country_id
    );

    //检测email账户信息
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "search.username.valid")
    Observable<ResultModel<EmailModel>> searEmail(@Field("member_id") int member_id,
                                                  @Field("email") String email
    );



    /*credit start*/

    //获取银行列表
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "bank.display")
    Observable<ResultModel<List<BankModel>>> getBanks(@Field("member_id") int member_id
    );

    /**
     * 获取提现银行列表
     *
     * @param country_id Id of the specified country id. Default: 4 (Malaysia)
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "get.bank.list.by.country.id")
    Observable<ResultModel<List<WithdrawBankModel>>> getWithdrawBanks(@Field("country_id") int country_id
    );


    /**
     * 获取(转账,取现,充值)历史记录
     *
     * @param member_id
     * @param filter    Return specified value(
     *                  last_one_week,last_one_month,past_six_month,last_twelve_month )
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.ledges.record")
    Observable<ResultModel<List<TransactionHisModel>>> getTransactionHisList(@Field("member_id") int member_id,
                                                                             @Field("filter") String filter
    );

    /**
     * 充值历史记录
     *
     * @param member_id
     * @param filter
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.topup.record")
    Observable<ResultModel<List<TopupHisModel>>> getTopupHisList(@Field("member_id") int member_id,
                                                                 @Field("filter") String filter
    );

    /**
     * 获取转账历史记录
     *
     * @param member_id
     * @param filter
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "memberFundTransfer.getDatas")
    Observable<ResultModel<List<TransferHisModel>>> getTransferHisList(@Field("member_id") int member_id,
                                                                       @Field("filter") String filter
    );

    /**
     * 获取提现历史记录
     *
     * @param member_id
     * @param filter
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.withdraw.record")
    Observable<ResultModel<List<WithdrawHisModel>>> getWithdrawHisList(@Field("member_id") int member_id,
                                                                       @Field("filter") String filter
    );

    //ATM充值
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "member.topup.submit")
    Observable<ResultModel> topupByAtm(@FieldMap Map<String, Object> map
    );

    /*order start*/

    //获取订单列表
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "{url}")
    Observable<ResultModel<SOrderItemModel>> getOrders(@Path("url") String url, @FieldMap Map<String, Object> map
    );


    /**
     * 取消订单原因列表
     *
     * @param language_code language code etc:’en’,’cn’ (Default: ‘en’)
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "order.cancel.status.get.all")
    Observable<ResultModel<List<OrderCancelModel>>> getOrderCancelContents(@Field("language_code") String language_code
    );

    //获取菜单
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "prod.get.first.level.cat")
    Observable<ResultModel<List<CategoryModel>>> getFirstCategorys(@Field("language_code") String language_code,
                                                                   @Field("get_all") String get_all
    );

    //获取首页的广告
    @POST(GlobalValue.Base_Version_Url + "template.settings.get.popup.message")
    Observable<ResultModel<AdvModel>> getAdvData();

    /**
     * 根据url地址找我们自己的产品id
     *
     * @param keyword
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "prod.url.search")
    Observable<ResultModel<ThirdContentModel>> getProductIdByUrl(@Field("keyword") String keyword, @Field("member_id") int member_id);

    /**
     * 通过淘宝口令获取商品详情
     * prod_key	string	product’s taokouling(淘口令)
     * lang	String	language example ‘en’
     * country_id	integer	Country’s ID. Default: 4
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "prod.taokou.search")
    Observable<ResultModel<TaokouModel>> getProductByKouling(@FieldMap Map<String, Object> map);

    /**
     * 图片搜索产品
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "prod.image.search")
    Observable<ResultModel<List<Map<String, SnapGoodsModel>>>> searchProductBySnap(@FieldMap Map<String, Object> map);

    //获取应用信息
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "mobile.app.version.get")
    Observable<ResultModel<List<UpdateModel>>> getAppInfo(@Field("type") String type, @Field("language_code") String language_code);

    //设置应用信息
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "mobile.app.version.set")
    Observable<ResultModel<UpdateModel>> setAppInfo(@FieldMap Map<String, Object> map);

    //设置H5版本
    @POST(GlobalValue.Base_Version_Url + "mobile.h5.web.version.new")
    Observable<ResultModel> setH5Version();

    //获取H5版本
    @FormUrlEncoded
    @POST(GlobalValue.Base_Version_Url + "mobile.h5.web.version.get")
    Observable<ResultModel<H5VersionModel>> getH5Version(@Field("type") String type);

    /**
     * @return 第三方商城来源
     * @Query("source_country_id") int source_country_id
     */
    @GET(GlobalValue.Base_Version_Url + "get.shopfromglobe.listing")
    Observable<ResultModel<List<ThridMallModel>>> getShopFromglobeListing();

}
